package com.codeiy.criteria;

/**
 * 查询条件的关联关系
 *
 * @author Bruce
 */
public enum Relation {
    /**
     * 关联关系
     */
    AND("AND"),
    OR("OR");

    private String rendered;

    Relation(String rendered) {
        this.rendered = rendered;
    }

    public String getRendered() {
        return rendered;
    }

    public static Relation statOf(String rendered) {
        for (Relation relation : values()) {
            if (relation.getRendered().equals(rendered)) {
                return relation;
            }
        }
        return null;
    }
}
